<template>
	<view class="content">
		<view class="hei20"></view>
		<view class="wid90 mar bacFFF borRad20" style="padding: 50rpx 0;">
			<view class="wid90 mar dis disAl">
				<view style="width: 25%;height: 128rpx;">
					<image :src="url+list.avatar" class="hei100 borRad50" style="width: 128rpx;"></image>
				</view>
				<view style="width: 75%;">
					<view class="dis disAl disJuB">
						<view class="foSi40 fowe600">{{list.name}}</view>
						<view class="foSi35 fowe600">{{list.status == 0?'男':'女'}}</view>
					</view>
					<view class="mar-top30 foSi20" style="opacity: 0.8;">注册时间：{{list.createtime}}</view>
				</view>
			</view>
		</view>
		<view class="wid90 mar bacFFF borRad20 mar-top30 foSi30 fowe600">
			<view style="height: 50rpx;"></view>
			<view class="wid90 mar">
				<view class="dis disAl disJuB">
					<view style="opacity: 0.7;">绑定微信</view>
					<view style="color: #010101;">{{list.user.nickname}}</view>
				</view>
				<view class="mar-top30 dis disAl disJuB">
					<view style="opacity: 0.7;">手机号码</view>
					<view style="color: #010101;">{{list.mobile}}</view>
				</view>
			</view>
			<view style="height: 50rpx;"></view>
		</view>
		<view class="wid90 mar bacFFF borRad20 mar-top30 foSi30 fowe600">
			<view class="wid90 mar dis disAl disJuB" style="height: 124rpx;">
				<view style="opacity: 0.7;">店长</view>
				<switch color="#035DFF" @click="identity(list.identity)" :checked='list.identity == 0' style="transform:scale(0.8)"/>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				url: this.global.url,
				list: '',
				id: '',
				yuan_userinfo: ''
			}
		},
		onLoad(option) {
			this.yuan_userinfo = uni.getStorageSync('yuan_userinfo')
			this.id = option.id
			this.getList()
		},
		onShow() {},
		methods: {
			identity(e){
				console.log(e);
				var identity = 0
				if(e == 0){
					var identity = 1
				}else{
					var identity = 0
				}
				var that = this;
				uni.request({
					url: that.global.url + '/api/qianyu_petrol/gasstation_clerk_identity',
					method: "POST",
					header: {
						'site-id': that.global.site_id,//自定义请求头信息
						'token': uni.getStorageSync('token')
					},
					data: {
						id: that.id,
						identity:identity
					},
					success(res) {
						let result = res.data
						console.log(result)
						if (result.code == 1) {
							that.list.identity=identity
						}
					}
				})
				
			},
			getList() {
				var that = this;
				uni.request({
					url: that.global.url + '/api/qianyu_petrol/gasstation_clerk_info',
					method: "POST",
					header: {
						'site-id': that.global.site_id,//自定义请求头信息
						'token': uni.getStorageSync('token')
					},
					data: {
						id: that.id
					},
					success(res) {
						let result = res.data
						console.log(result)
						if (result.code == 1) {
							that.list = result.data
						}
					}
				})
			},
			tiaozhuan(url) {
				uni.navigateTo({
					url: url
				})
			}
		}
	}
</script>

<style>
	.content {
		background: #F8F9FD;
		height: 100vh;
	}
	.xia{
		height: 1rpx;
		background-color: #E5E5E5;
	}
</style>
